from django.db import models

# Create your models here.


class Dlmodel(models.Model):
    sjh = models.CharField(max_length=11, verbose_name="手机号")

    class Meta:
        db_table = 'dl'
        verbose_name_plural = "登录"

    def __str__(self):
        return self.sjh


class Flmodel(models.Model):
    fl = models.CharField(max_length=12, verbose_name="分类")
    tp = models.CharField(max_length=320, verbose_name="图片")

    class Meta:
        db_table = 'fl'
        verbose_name_plural = "分类"

    def __str__(self):
        return self.fl


class Ddmodel(models.Model):
    PAY_STATUS = (
        (1, '待支付'),
        (2, '待发货'),
        (3, '待收货'),
        (4, '待评价'),
        (5, '已完成'),
        (6, '已取消'),
    )
    mc = models.CharField(max_length=24, verbose_name="订单名称")
    jg = models.DecimalField(max_digits=14, decimal_places=2, verbose_name="订单价格")
    rq = models.DateTimeField(verbose_name="订单日期")
    zt = models.SmallIntegerField(default=1, choices=PAY_STATUS, verbose_name="订单状态")
    tp = models.CharField(max_length=320, verbose_name="订单图片")
    ss = models.ForeignKey(to=Dlmodel, on_delete=models.CASCADE, verbose_name="所属账号")

    class Meta:
        db_table = 'dd'
        verbose_name_plural = "订单"

    def __str__(self):
        return self.mc

